﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CameraBranchNavigation.aspx.cs" Inherits="ZHDJ.Web.Portal.Other.CameraBranchNavigation" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <title></title>
    <link href="../../Resource/themes/default/css/jqtree.css" rel="stylesheet" />
    <script src="../../Resource/js/default/jquery.min.1.12.js"></script>
    <script src="../../Resource/js/jquery/tree.jquery.js"></script>
    <script type="text/javascript">

        var BindTreeClick = function () {
            $('#tree1').bind(
                'tree.click',
                function (event) {
                    var node = event.node;
                    if (node.level !== 0) {
                        $("#branchdaolink").attr("href", "../BranchIndex.aspx?BranchID=" + node.id);
                        $("span", "#branchdaolink").click();
                        window.parent.closeDaoheng();
                    }
                }
            );
        }
        var treePara = {
            closedIcon: $('<img class="fa " src="../../Resource/themes/default/images/Default/triangle1.gif" />'),
            openedIcon: $('<img class="fa " src="../../Resource/themes/default/images/Default/triangle3.gif" />'),
            selectable: true,
            autoEscape: false,
            autoOpen: 0,
            onCreateLi: function (node, $li) {
                // Add 'icon' span before title
                //$li.find('.jqtree-title').before('<span class="icon"></span>');
            }
        };
        $(function () {


            $('#tree1').tree(treePara);
            
            BindTreeClick();

            $("#btnSearch").click(function () {
                var dataUrl = "CameraBranchNavigation.aspx?Json=1&Search=" + $("#QueryText").val();
                $('#tree1').tree('loadDataFromUrl', dataUrl);
            });
            var dd = $(".jqtree-tree[role='tree']");
            dd.eq(0).css({ "height": "0" });
        });

    </script>
    <style>
        body {
            margin: 0 auto;
            font-size: 12px;
            font-family: "宋体", Arial, Helvetica, sans-serif;
            line-height: normal;
            background-repeat: repeat-x;
            background-position: top;
        }

        .btn {
            height: 25px;
            width: 50px;
        }
    </style>
</head>
<body>

    <form id="form1" runat="server">
        <div>
            <table style="width: 100%">
                <tr>
                    <td style="width: 155px">
                        <input id="QueryText" type="text" style="width: 98%" />
                    </td>
                    <td>
                        <button type="button" class="btn" id="btnSearch">搜索</button></td>
                </tr>
            </table>
        </div>
        <div style="height: 297px; width: 238px; background-color: #ffffff; padding-left: 10px; overflow: auto; border-top: #ccc solid 2px;">


            <div id="tree1" data-url="CameraBranchNavigation.aspx?Json=1"></div>

        </div>

        <div style="display: none"><a id="branchdaolink" href="#" target="_blank"><span>33</span></a></div>
    </form>

</body>
</html>